package me.softwareengineer.guice.rendering.domain;

/**
 * Represents Syntax or the script language in document.
 * <p>
 * We already define some common syntaxes for example xhtml 1.0. Please check
 * {@link #XHTML_1_0} ,{@link #HTML_4_01}, {@link #XWIKI_1_0},
 * {@link #XWIKI_2_0}, {@link #XWIKI_2_1}, {@link #PLAIN_1_0}, {@link #TEX_1_0},
 * {@link #TWIKI_1_0}, {@link #JSPWIKI_1_0}, {@link #CONFLUENCE_1_0},
 * {@link #CREOLE_1_0}, {@link #MEDIAWIKI_1_0}
 * </p>
 * 
 * @author yadtahir
 * @see RawElement <pre>
 * This class is immutable and thread-safe.
 * </pre>
 */
public final class Syntax {
	/**
	 * Represents XHTML 1.0 Syntax
	 */
	public static final Syntax XHTML_1_0 = new Syntax("XHTML", "1.0", "xhtml");
	/**
	 * Represents HTML 4.01 Syntax
	 */
	public static final Syntax HTML_4_01 = new Syntax("HTML", "4.01", "html");
	/**
	 * Represents XWIKI 1.0 Syntax
	 */
	public static final Syntax XWIKI_1_0 = new Syntax("XWiki", "1.0", "xwiki");
	/**
	 * Represents XWIKI 2.0 Syntax
	 */
	public static final Syntax XWIKI_2_0 = new Syntax("XWiki", "2.0", "xwiki");
	/**
	 * Represents XWIKI 2.1 Syntax
	 */
	public static final Syntax XWIKI_2_1 = new Syntax("XWiki", "2.1", "xwiki");
	/**
	 * Represents Plain Text Syntax
	 */
	public static final Syntax PLAIN_1_0 = new Syntax("Plain", "1.0", "plain");

	/**
	 * Represents TeX 1.0 Syntax
	 */
	public static final Syntax TEX_1_0 = new Syntax("TeX", "1.0", "tex");
	/**
	 * Represents Creole 1.0 Syntax
	 */
	public static final Syntax CREOLE_1_0 = new Syntax("Creole", "1.0",
			"creole");
	/**
	 * Represents JSPWiki 1.0 Syntax
	 */
	public static final Syntax JSPWIKI_1_0 = new Syntax("JSPWiki", "1.0",
			"jspwiki");
	/**
	 * Represents MediaWiki 1.0 Syntax
	 */
	public static final Syntax MEDIAWIKI_1_0 = new Syntax("MediaWiki", "1.0",
			"mediawiki");
	/**
	 * Represents Confluence 1.0 Syntax
	 */
	public static final Syntax CONFLUENCE_1_0 = new Syntax("Confluence", "1.0",
			"confluence");
	/**
	 * Represents TWiki 1.0 Syntax
	 */
	public static final Syntax TWIKI_1_0 = new Syntax("TWiki", "1.0", "twiki");

	/**
	 * The name of syntax
	 */
	private String name;

	/**
	 * Holds the version of the syntax
	 */
	private String version;
	/**
	 * Holds the id of the syntax
	 */
	private String id;

	/**
	 * Constructs a syntax object
	 * 
	 * @param name
	 *            the name of the syntax. for example 'xhtml'
	 * @param version
	 *            the version of the syntax. for example, for wiki2.0, the
	 *            version should be '2.0'
	 * @param id
	 *            the id of the syntax. For example, for the id of TeX is tex
	 */
	public Syntax(String name, String version, String id) {
		this.name = name;
		this.version = version;
		this.id = id;
	}

	/**
	 * 
	 * @return the id of the syntax. For example: the id of TeX syntax is tex
	 */
	public String getId() {
		return id;
	}

	/**
	 * 
	 * @return the name of the syntax. For instance: Wiki, HTML, etc.
	 */
	public String getName() {
		return name;
	}

	/**
	 * 
	 * @return the version of the syntax. For example: the version of Wiki2.0 is
	 *         '2.0'
	 */
	public String getVersion() {
		return version;
	}
}
